package com.wangxl;

/**
 * 季节枚举测试类
 * @author wangxl
 * @date 2022/2/17 15:59
 */
public class SeasonEnumTest {

    public static void main(String[] args) {

        // 输出某一个枚举的值
        System.out.println(SeasonEnum.SPRING.getName());

        // 设置SUMMER的名称和值
        SeasonEnum.SUMMER.setName("夏天天");
        SeasonEnum.SUMMER.setCode(222);

        //遍历所有枚举信息
        for (SeasonEnum season : SeasonEnum.values()){
            System.out.println(season + " code: " + season.getCode() + " name: " + season.getName());
        }

    }
}
